package sample;

import javafx.geometry.Insets;
import javafx.scene.canvas.Canvas;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;

public class ThirdAnchorPane {

    public AnchorPane ThirdAnchorPane() throws Exception{
        AnchorPane anchorPane = new AnchorPane();
        String relativePath = BeautyMain.themeURL+"\\vivo\\vigour_window_bg_dark.9.png";
        Canvas imageView =   BlackBorder.get9NewImageCanvas(relativePath,1080,1920);

        TopPart topPart = new TopPart();

        anchorPane.getChildren().addAll(imageView,topPart.anchorPaneTopPart(),CenterAndBottom());

        return  anchorPane;

    }
    //中部和底部
    public AnchorPane CenterAndBottom()throws Exception{
        if(BeautyMain.themeURL==null||BeautyMain.themeURL==""){
            return new AnchorPane();
        }
        AnchorPane hBox = new AnchorPane();
        HBox hBox1 = new HBox();
//        hBox1.getChildren().add(BottomPart());
//        hBox1.setPadding(new Insets(780,0,0,0));
//        hBox.getChildren().addAll(SmartDialling(),Dial(),hBox1);

        hBox.getChildren().add(centrAndBottom());
        return hBox;
    }
    public HBox centrAndBottom()throws Exception{
        HBox hBox = new HBox();
        VBox vBox = new VBox();

        vBox.setPadding(new Insets(30,0,0,0));
        VBox vBox1 = new VBox();
        //vBox1.getChildren().addAll( chatTime(),Myattitude());
        vBox1.setPadding(new Insets(10,0,0,0));
        VBox vBox2 = new VBox();
        //vBox2.getChildren().addAll(chatTime(),NotReplace());
        vBox2.setPadding(new Insets(100,0,0,0));
        vBox.getChildren().addAll(editor(),call(),InformationAll());
        hBox.getChildren().addAll(vBox);
        //hBox.setStyle("-fx-background-color: red");
        hBox.setMaxWidth(480);
        hBox.setMinWidth(480);
        hBox.setPrefWidth(480);
        hBox.setPadding(new Insets(-2,0,0,0));
        return  hBox;
    }

    public HBox editor()throws Exception{
        HBox hBox = new HBox();
        hBox.setPrefWidth(480);
        hBox.setPrefHeight(55);

        HBox leftBox = new HBox();
        String relativePath = BeautyMain.themeURL+"\\vivo\\vigour_btn_title_create_center_multimedia_normal_dark.9.png";//参数是假的
        Canvas imageView =   BlackBorder.get9NewImageCanvas(relativePath,120,120);
        imageView.setHeight(40);
        imageView.setWidth(40);

        leftBox.getChildren().addAll(imageView);
        //leftBox.setStyle("-fx-background-color: red");
        leftBox.setMargin(imageView,new Insets(0,20,0,0));
        leftBox.setPadding(new Insets(0,0,0,15));
        HBox centerBox = new HBox();
        Label label = new Label();
        label.setText("信息");
        Font font = new Font("黑体",22);
        String url = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param = "windowTitleColor";
        String colorFont =   DOM4JTest.attrValue(url,param);
        label.setTextFill(Color.web("rgba("+colorFont+")"));

        label.setFont(font);
        //centerBox.setPadding(new Insets(15,0,0,85));
        centerBox.setMargin((label),new Insets(15,0,0,150));
        centerBox.getChildren().addAll(label);


        url = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        param = "windowTitleColor";

        colorFont =   DOM4JTest.attrValue(url,param);

        HBox rightBox = new HBox();
        Label label1 = new Label();
        label1.setText("编辑");
        label1.setFont(font);
        label1.setTextFill(Color.web("rgba("+colorFont+")"));
        //rightBox.setPadding(new Insets(15,0,0,160));
        rightBox.setMargin(label1,new Insets(15,0,0,20));
        rightBox.getChildren().addAll(label1);

        // hBox.setPadding(new Insets(0,0,0,0));
        AnchorPane anchorPane = new AnchorPane();
        String relativePath2 = BeautyMain.themeURL+"\\com.android.dialer\\activity_title_bar_44.9.png";//参数是假的
        Canvas imageView2 =   BlackBorder.get9NewImageCanvas(relativePath2,1080,140);
        HBox hBox1 = new HBox();
        hBox1.getChildren().addAll(rightBox,centerBox,leftBox);
        anchorPane.getChildren().addAll(imageView2,hBox1);

        hBox.getChildren().addAll(anchorPane);
        hBox1.setMargin(leftBox,new Insets(3,0,0,150));
//        hBox.setPrefWidth(480);
//        hBox.setMinWidth(480);
//        hBox.setMaxWidth(480);
        SetSize.SetElementSize(hBox,480,60);
        //hBox.setStyle("-fx-background-color: red");

        return hBox;
    }

    public HBox call() throws Exception{
        HBox hBox = new HBox();
        AnchorPane anchorPane = new AnchorPane();
        hBox.setPrefHeight(59);
        hBox.setPrefWidth(480);
//        String relativePath = BeautyMain.themeURL+"\\vivo\\compose_head_bg.9.png";
//        Canvas imageView =   BlackBorder.get9ImageCanvas(relativePath,480,59,1.0f,0.8f);
        String relativePath = BeautyMain.themeURL+"\\vivo\\vigour_list_search_bar_bg_dark.9.png";
        Canvas imageView =   BlackBorder.get9ImageCanvas(relativePath,480,59,1.0f,0.8f);

        relativePath =BeautyMain.themeURL+"\\com.android.mms\\edittext_bg.9.png";
        Canvas imageView1 = BlackBorder.get9ImageCanvas(relativePath,1128,117,0.4f,0.3f);

        HBox hBox1 = new HBox();
        AnchorPane anchorPane1 = new AnchorPane();
        Label label = new Label();
        label.setText("搜索信息");
        Font font = new Font("黑体",20);
        String url = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param = "edittext_hint_color";
        String colorFont =   DOM4JTest.attrValue(url,param);
        label.setTextFill(Color.web("rgba("+colorFont+")"));
        label.setFont(font);
        HBox hBox3 = new HBox();

        //label.setPadding(new Insets(10,0,0,100));
        hBox3.setMargin(label,new Insets(10,0,0,0));
        String relativePath3 = BeautyMain.themeURL+"\\vivo\\vigour_list_search_icon_dark.png";
        Canvas imageView3 =   BlackBorder.get9NewImageCanvas(relativePath3,90,90);
        //imageView3.setStyle("-fx-background-color: red");
        HBox hBox4 = new HBox();
        hBox4.getChildren().add(imageView3);
        hBox3.getChildren().addAll(hBox4,label);
        hBox3.setMargin(label,new Insets(10,0,0,-50));
        hBox3.setMargin(hBox4,new Insets(5,0,0,20));
        hBox4.setMaxWidth(90);
        hBox4.setMinWidth(90);
        // hBox4.setStyle("-fx-background-color: red");
        // hBox4.setPadding(new Insets(0,0,0,50));
        HBox hBox2 = new HBox();
        hBox2.getChildren().addAll(imageView1);
        //hBox2.setStyle("-fx-background-color: red");
        hBox2.setMaxWidth(480);
        hBox2.setMinWidth(480);
        hBox2.setPrefWidth(480);
        hBox2.setMargin(imageView1,new Insets(5,0,0,15));
        anchorPane1.getChildren().addAll(hBox2,hBox3);
        hBox1.getChildren().add(anchorPane1);

        HBox.setMargin(hBox1,new Insets(0,30,0,0));



        //anchorPane.setStyle("-fx-background-color: red");
        SetSize.SetElementSize(anchorPane,480,50);
        anchorPane.getChildren().addAll(imageView,hBox1);
        hBox.getChildren().addAll(anchorPane);

        HBox hBox5 = new HBox();
        hBox5.getChildren().add(hBox);

        SetSize.SetElementSize(hBox5,480,50);

        //hBox5.setStyle("-fx-background-color: green");
        return hBox5;
    }

    public VBox  InformationAll()throws Exception{
        VBox vBox = new VBox();
        SetSize.SetWidthSize(vBox,480);

        //vBox.setStyle("-fx-background-color: red");
        vBox.getChildren().addAll(Information1(),Information2(),Information3(),Information4(),Information5());
        return vBox;
    }

    public  VBox Information1()throws Exception{

        AnchorPane anchorPane = new AnchorPane();

        SetSize.SetWidthSize(anchorPane,480);
        String relativePath1 = BeautyMain.themeURL+"\\vivo\\vigour_divider_horizontal_dark.9.png";
        Canvas imageView1 =   BlackBorder.get9NewImageCanvas(relativePath1,1035,2);
        VBox line = new VBox();
        line.getChildren().addAll(imageView1);
        line.setPadding(new Insets(65,0,0,20));

        /**
         * 电话
         */
        Font font = new Font("Arial",20);
        VBox vBox = new VBox();
        Label number = new Label();
        number.setText("10086");

        String url1 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param1 = "text_normal_color";
        String colorFont1 =   DOM4JTest.attrValue(url1,param1);
        number.setTextFill(Color.web("rgba("+colorFont1+")"));
        number.setPadding(new Insets(7,0,0,20));
        SetFont.setFont(number,"/sample/res/times.ttf",23);

        /**
         * 内容
         */
        //font=new Font("微软雅黑",20);
        Label content = new Label();
        content.setText("尊敬的客户，您好！您本月 -国内移动数据总…");

        content.setPadding(new Insets(35,0,0,20));
        String url2 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param2 = "text_second_normal_color";
        String colorFont2 =   DOM4JTest.attrValue(url2,param2);
        content.setTextFill(Color.web("rgba("+colorFont2+")"));

        SetFont.setFont(content,"/sample/res/msyh.ttf",17);

        /**
         * 时间
         */
        font = new Font("Arial",17);
        Label time1 = new Label();
        time1.setText("09:58");

        String url3 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param3 = "text_normal_color";
        String colorFont3 =   DOM4JTest.attrValue(url3,param3);
        time1.setTextFill(Color.web("rgba("+colorFont3+")"));
        time1.setPadding(new Insets(12,0,0,420));
        SetFont.setFont(time1,"/sample/res/msyh.ttf",15);


        anchorPane.getChildren().addAll(line,number,content,time1);
        vBox.getChildren().addAll(anchorPane);
        SetSize.SetWidthSize(vBox,480);
        // vBox.setStyle("-fx-background-color: blue");
        return vBox;

    }

    public  VBox Information2()throws Exception{

        AnchorPane anchorPane = new AnchorPane();

        SetSize.SetWidthSize(anchorPane,480);
        String relativePath1 = BeautyMain.themeURL+"\\vivo\\vigour_divider_horizontal_dark.9.png";
        Canvas imageView1 =   BlackBorder.get9NewImageCanvas(relativePath1,1035,2);
        VBox line = new VBox();
        line.getChildren().addAll(imageView1);
        line.setPadding(new Insets(65,0,0,20));

        /**
         * 电话
         */

        VBox vBox = new VBox();
        Label number = new Label();
        number.setText("糖糖");
        SetFont.setFont(number,"/sample/res/msyh.ttf",21);
        String url1 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param1 = "text_normal_color";
        String colorFont1 =   DOM4JTest.attrValue(url1,param1);
        number.setTextFill(Color.web("rgba("+colorFont1+")"));
        number.setPadding(new Insets(6,0,0,20));
        /**
         * 内容
         */

        Label content = new Label();
        content.setText("您好，非常感谢你的喜欢～我们会继续努力呢^ω^");
        SetFont.setFont(content,"/sample/res/msyh.ttf",17);
        content.setPadding(new Insets(35,0,0,20));
        String url2 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param2 = "text_second_normal_color";
        String colorFont2 =   DOM4JTest.attrValue(url2,param2);
        content.setTextFill(Color.web("rgba("+colorFont2+")"));


        /**
         * 时间
         */

        Label time1 = new Label();
        time1.setText("1月12日");
        SetFont.setFont(time1,"/sample/res/msyh.ttf",15);
        String url3 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param3 = "text_normal_color";
        String colorFont3 =   DOM4JTest.attrValue(url3,param3);
        time1.setTextFill(Color.web("rgba("+colorFont3+")"));
        time1.setPadding(new Insets(12,0,0,405));
        // time1.setStyle("-fx-font-family: 微软雅黑");



        anchorPane.getChildren().addAll(line,number,content,time1);
        vBox.getChildren().addAll(anchorPane);
        SetSize.SetWidthSize(vBox,480);
        // vBox.setStyle("-fx-background-color: blue");
        return vBox;

    }

    public  VBox Information3()throws Exception{

        AnchorPane anchorPane = new AnchorPane();

        SetSize.SetWidthSize(anchorPane,480);
        String relativePath1 = BeautyMain.themeURL+"\\vivo\\vigour_divider_horizontal_dark.9.png";
        Canvas imageView1 =   BlackBorder.get9NewImageCanvas(relativePath1,1035,2);
        VBox line = new VBox();
        line.getChildren().addAll(imageView1);
        line.setPadding(new Insets(65,0,0,20));

        /**
         * 电话
         */

        VBox vBox = new VBox();
        Label number = new Label();
        number.setText("10010");
        SetFont.setFont(number,"/sample/res/times.ttf",23);
        String url1 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param1 = "text_normal_color";
        String colorFont1 =   DOM4JTest.attrValue(url1,param1);
        number.setTextFill(Color.web("rgba("+colorFont1+")"));
        number.setPadding(new Insets(7,0,0,20));
        /**
         * 内容
         */

        Label content = new Label();
        content.setText("温馨提示:至28日10时27分，您的账户当前可用...");
        SetFont.setFont(content,"/sample/res/msyh.ttf",17);
        content.setPadding(new Insets(35,0,0,20));
        String url2 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param2 = "text_second_normal_color";
        String colorFont2 =   DOM4JTest.attrValue(url2,param2);
        content.setTextFill(Color.web("rgba("+colorFont2+")"));


        /**
         * 时间
         */

        Label time1 = new Label();
        time1.setText("2017年11月28日");
        SetFont.setFont(time1,"/sample/res/msyh.ttf",15);
        String url3 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param3 = "text_normal_color";
        String colorFont3 =   DOM4JTest.attrValue(url3,param3);
        time1.setTextFill(Color.web("rgba("+colorFont3+")"));
        time1.setPadding(new Insets(12,0,0,345));



        anchorPane.getChildren().addAll(line,number,content,time1);
        vBox.getChildren().addAll(anchorPane);
        SetSize.SetWidthSize(vBox,480);
        // vBox.setStyle("-fx-background-color: blue");
        return vBox;

    }

    public  VBox Information4()throws Exception{

        AnchorPane anchorPane = new AnchorPane();

        SetSize.SetWidthSize(anchorPane,480);
        String relativePath1 = BeautyMain.themeURL+"\\vivo\\vigour_divider_horizontal_dark.9.png";
        Canvas imageView1 =   BlackBorder.get9NewImageCanvas(relativePath1,1035,2);
        VBox line = new VBox();
        line.getChildren().addAll(imageView1);
        line.setPadding(new Insets(65,0,0,20));

        /**
         * 电话
         */

        VBox vBox = new VBox();
        Label number = new Label();
        number.setText("10658139126883043017");
        SetFont.setFont(number,"/sample/res/times.ttf",23);
        String url1 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param1 = "text_normal_color";
        String colorFont1 =   DOM4JTest.attrValue(url1,param1);
        number.setTextFill(Color.web("rgba("+colorFont1+")"));
        number.setPadding(new Insets(7,0,0,20));
        /**
         * 内容
         */

        Label content = new Label();
        content.setText("【江苏移动】尊敬的客户，4月积分账单已送达...");
        SetFont.setFont(content,"/sample/res/msyh.ttf",17);
        content.setPadding(new Insets(35,0,0,20));
        String url2 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param2 = "text_second_normal_color";
        String colorFont2 =   DOM4JTest.attrValue(url2,param2);
        content.setTextFill(Color.web("rgba("+colorFont2+")"));


        /**
         * 时间
         */

        Label time1 = new Label();
        time1.setText("2017年5月22日");
        SetFont.setFont(time1,"/sample/res/msyh.ttf",15);
        String url3 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param3 = "text_normal_color";
        String colorFont3 =   DOM4JTest.attrValue(url3,param3);
        time1.setTextFill(Color.web("rgba("+colorFont3+")"));
        time1.setPadding(new Insets(12,0,0,355));



        anchorPane.getChildren().addAll(line,number,content,time1);
        vBox.getChildren().addAll(anchorPane);
        SetSize.SetWidthSize(vBox,480);
        // vBox.setStyle("-fx-background-color: blue");
        return vBox;

    }

    public  VBox Information5()throws Exception{

        AnchorPane anchorPane = new AnchorPane();

        SetSize.SetWidthSize(anchorPane,480);
        String relativePath1 = BeautyMain.themeURL+"\\vivo\\vigour_divider_horizontal_dark.9.png";
        Canvas imageView1 =   BlackBorder.get9NewImageCanvas(relativePath1,1035,2);
        VBox line = new VBox();
        line.getChildren().addAll(imageView1);
        line.setPadding(new Insets(65,0,0,20));

        /**
         * 电话
         */

        VBox vBox = new VBox();
        Label number = new Label();
        number.setText("10658139126927688209");
        SetFont.setFont(number,"/sample/res/times.ttf",23);
        String url1 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param1 = "text_normal_color";
        String colorFont1 =   DOM4JTest.attrValue(url1,param1);
        number.setTextFill(Color.web("rgba("+colorFont1+")"));
        number.setPadding(new Insets(7,0,0,20));
        /**
         * 内容
         */

        Label content = new Label();
        content.setText("【江苏移动】不换机、不换卡，一招教您拥有另...");
        SetFont.setFont(content,"/sample/res/msyh.ttf",17);
        content.setPadding(new Insets(35,0,0,20));
        String url2 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param2 = "text_second_normal_color";
        String colorFont2 =   DOM4JTest.attrValue(url2,param2);
        content.setTextFill(Color.web("rgba("+colorFont2+")"));


        /**
         * 时间
         */

        Label time1 = new Label();
        time1.setText("2017年5月22日");
        SetFont.setFont(time1,"/sample/res/msyh.ttf",15);
        String url3 = BeautyMain.themeURL+"\\vivo\\theme_values.xml";
        String param3 = "text_normal_color";
        String colorFont3 =   DOM4JTest.attrValue(url3,param3);
        time1.setTextFill(Color.web("rgba("+colorFont3+")"));
        time1.setPadding(new Insets(12,0,0,355));



        anchorPane.getChildren().addAll(line,number,content,time1);
        vBox.getChildren().addAll(anchorPane);
        SetSize.SetWidthSize(vBox,480);
        // vBox.setStyle("-fx-background-color: blue");
        return vBox;

    }


}
